// --------------------------------------------------------------------------------------------------------------------
// <copyright file="PickAndMove.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Microsoft.Robotics.Manipulation.PicknPlace
{
    using System;
    using System.Runtime.Serialization;
    using Microsoft.Robotics.Numerics;
    using Microsoft.Robotics.PhysicalObjects;

    /// <summary>
    /// Specifies a pick and move operation
    /// </summary>
    [DataContract]
    public class PickAndMove
    {
        /// <summary>
        /// Pick operating mode
        /// </summary>
        [DataMember]
        public readonly PicknPlaceModeEnum PickMode;

        /// <summary>
        /// Initializes a new instance of the <see cref="PickAndMove" /> class
        /// Initiates an operation to pick an object from a location and move to a second
        /// location
        /// </summary>
        /// <param name="manipulatedObjectDescription">Picked object</param>
        /// <param name="pickFromPose">Object pose in pick location</param>
        /// <param name="moveToPose">Placed object pose</param>
        /// <param name="pickMode">Pick operating mode</param>
        public PickAndMove(
            PhysicalObjectDescription manipulatedObjectDescription,
            Pose pickFromPose,
            Pose moveToPose,
            PicknPlaceModeEnum pickMode)
        {
            this.ManipulatedObjectDescription = manipulatedObjectDescription;
            this.PickFromPose = pickFromPose;
            this.MoveToPose = moveToPose;
            this.PickMode = pickMode;
        }

        /// <summary>
        /// Gets a description of the picked object
        /// </summary>
        [DataMember]
        public PhysicalObjectDescription ManipulatedObjectDescription { get; private set; }

        /// <summary>
        /// Gets object's pick location and orientation
        /// </summary>
        [DataMember]
        public Pose PickFromPose { get; private set; }

        /// <summary>
        /// Gets destination of the move message.
        /// </summary>
        [DataMember]
        public Pose MoveToPose { get; private set; }
    }
}
